Harden MCP safety boundaries and streamline authorized messaging - #2
Conversation
Review: request changesThe boundary fixes are correct and well tested, but the PR adds one confirmed receive regression and several changes that work against the streamlined-UX goal. CI is green (Node 22/24, Docker image, fmsg-docker acceptance). I ran two local probes against the branch and Blocking1.
2. Attachment saving is removed with nothing to replace it.
Should fix (UX and agent behaviour)3. "Data, not instructions" framing is now on everything.
4. The injection wording got weaker exactly where it matters.
5. Upstream error text is now unbounded. 6. Browser dev tools are blocked on loopback. 7. README lost a working recipe and contradicts itself.
8. 9. New startup failures are invisible in stdio hosts.
Minor
Checked and fine
🤖 Generated with Claude Code |
Attachment downloads could overwrite local files while advertised as read-only, and non-loopback HTTP deployments could skip Host/Origin validation. This change fixes those MCP boundaries while keeping messaging permissions and quotas in fmsg-webapi.
Normal stdio setup remains an HTTPS API URL and key. Authorized conversations and automation gain no additional MCP confirmation gate; the AI host's approval settings still apply.
Changes
download_attachmentread-only with a 256 KiB default inline budget enforced while streaming. Return text attachments as text and images once. Add opt-in stdiosave_attachment, enabled byFMSG_MCP_DOWNLOAD_DIR, which streams directly to generated filenames without model-supplied paths or overwrites. Repeat saves create numbered filenames. Attachment streams use response-header and idle deadlines, allowing progressing downloads to exceed 60 seconds. The operator controls the destination folder and its ancestors; registry metadata exposes the optional setting.send()reports replacement count and transmitted topic. Bound error previews at 2 KiB while preserving canonical JSON 400/413 host-policy explanations and delivery codes.Validation
129cac1: Node 22, Node 24, Docker image build/version check, and real two-host fmsg-docker acceptance including cross-account isolation. Docker acceptance ran in CI because Docker is unavailable locally.Release and follow-up
Target the next release as 0.2.0 because the old download
save_to/saved_tocontract is removed. The release workflow continues to set package versions from the release tag and publish to npm; this PR does not publish a release.Receive pagination/cursor correctness, broader service/output budgets, practical attachment upload workflows, host compatibility testing and hosted OAuth remain tracked in
ROADMAP.md.